﻿using System.Collections.Generic;
using System.Threading.Tasks;

namespace SimulationCenter.Tasks.Svrs
{
    /// <summary>
    /// 设备服务
    /// </summary>
    public interface IDeviceSvr
    {
        /// <summary>
        /// 设置设备为空闲
        /// </summary>
        /// <param name="serials">设备号数组</param>
        /// <returns></returns>
        Task SetDeviceFree(params string[] serials);

        /// <summary>
        /// 设置多个设备为繁忙
        /// </summary>
        /// <param name="serials">设备号数组</param>
        /// <returns></returns>
        Task SetDevicesBusy(params string[] serials);

        /// <summary>
        /// 设置多个设备为无效
        /// </summary>
        /// <param name="serials">设备号数组</param>
        /// <returns></returns>
        Task SetDevicesInValid(params string[] serials);

        /// <summary>
        /// 获取所有空闲设备
        /// </summary>
        /// <returns></returns>
        Task<List<ScDevice>> GetFreeDevices();

        /// <summary>
        /// 根据设备号获取设备
        /// </summary>
        /// <param name="serial"></param>
        /// <returns></returns>
        Task<ScDevice> GetDevice(string serial);
    }
}
